﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using ServicesLibrary.DataAccessLayer;
using ServicesLibrary.Models;
using ServicesLibrary.Services;

namespace ServicesLibrary.Services
{
    
    public class AuthenticationService : IAuthenticationService
    {
        DataAccesHelper helper = new DataAccesHelper();

        public bool checkLogin(string USERNAME, string PASSWORD, string SECRET_KEY)
        {
            //sample code for using secret key
            if (SECRET_KEY != null)
            { 
                if(helper.checkLogin(USERNAME,PASSWORD))
                    return true;
                return false;
            }
            else {
                return false;
            }
        }
        public string getCurrentUserName(string USERNAME, string SECRET_KEY)
        {
            if (SECRET_KEY != null)
            {
                return helper.getCurrentDisplayName(USERNAME);
            }
            else
            {
                return null;
            }
        }
        public AuthenticationModel getAuthenticationInfo(string USERNAME, string PASSWORD, string SECRET_KEY)
        {
            if (SECRET_KEY != null)
            {
                return helper.getAuthenticationInfo(USERNAME, PASSWORD);
            }
            else return null;
        }

    }
}
